#include<sys/types.h>
#include<sys/socket.h>
#include<arpa/inet.h>
#include<unistd.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <netinet/in.h>

int main(int argc,char **argv)
{
    int sockfd;
    if(sockfd=socket(AF_INET,SOCK_STREAM,0)<0)
    {
        perror("socket error\n");
        exit(1);
    }
    struct sockaddr_in s_addr;
    s_addr.sin_family=AF_INET;
    s_addr.sin_port=htons(6666);
    s_addr.sin_addr.s_addr=inet_addr("127.0.0.1");

    if(connect(sockfd,(struct sockaddr *)&s_addr,sizeof(struct sockaddr))!=0)
    {
        perror("connect error\n");
        exit(1);
    }

    shutdown(sockfd,SHUT_RDWR);
    return 0;
}